import React, { Component } from 'react';
import { Grid } from 'antd-mobile';
import { HotCateBox } from './style'
import connect from './connect'
import { withRouter } from 'react-router-dom'


@connect
@withRouter
class Hotcate extends Component {
    render() {
        return (
            <HotCateBox>
                <div>热门分类</div>
                <Grid
                    data={this.props.hotcate}
                    activeStyle={false}
                    itemStyle={{ height: "40px" }}
                    renderItem={item => (
                        <div style={{ padding: '2px' }} onClick={() => {
                            console.log(item.id);
                            console.log(this.props.history);
                        }}>
                            <div style={{ color: '#A7A7A7', fontSize: '14px', marginTop: '-5px' }}>
                                <span>{item.text}</span>
                            </div>
                        </div>
                    )}
                />
            </HotCateBox>
        );
    }
}

export default Hotcate;
